package testcase;

import java.io.IOException;

import junit.framework.TestCase;
import Data.DictionaryData;
import analyzer.Analyzer;
import io.IO;

public class Analyzer_testcase extends TestCase{
	
	public void test_boy() throws IOException{
		DictionaryData.getDictionary();
		boolean result;
		Analyzer analyzer=new Analyzer();
		result= analyzer.modifier("boy");
		assertEquals(result, true);
	}
	
	public void test_BOY() throws IOException{
		DictionaryData.getDictionary();
		boolean result;
		Analyzer analyzer=new Analyzer();
		result= analyzer.modifier("BOY");
		assertEquals(result, true);
	}

	public void test_apple() throws IOException{
		DictionaryData.getDictionary();
		boolean result;
		Analyzer analyzer=new Analyzer();
		result= analyzer.modifier("apple");
		assertEquals(result, true);
	}
	
	public void test_Apple() throws IOException{
		DictionaryData.getDictionary();
		boolean result;
		Analyzer analyzer=new Analyzer();
		result= analyzer.modifier("Apple");
		assertEquals(result, true);
	}
	
	public void test_Apple123() throws IOException{
		DictionaryData.getDictionary();
		boolean result;
		Analyzer analyzer=new Analyzer();
		result= analyzer.modifier("Apple123");
		assertEquals(result, false);
	}
	
	public void test_123() throws IOException{
		DictionaryData.getDictionary();
		boolean result;
		Analyzer analyzer=new Analyzer();
		result= analyzer.modifier("123");
		assertEquals(result, false);
	}
	
	public void test_123apple() throws IOException{
		DictionaryData.getDictionary();
		boolean result;
		Analyzer analyzer=new Analyzer();
		result= analyzer.modifier("123apple");
		assertEquals(result, false);
	}
	
	public void test_apple_tree() throws IOException{
		DictionaryData.getDictionary();
		boolean result;
		Analyzer analyzer=new Analyzer();
		result= analyzer.modifier("apple_tree");
		assertEquals(result, false);
	}
	
	public void test_appletree() throws IOException{
		DictionaryData.getDictionary();
		boolean result;
		Analyzer analyzer=new Analyzer();
		result= analyzer.modifier("apple tree");
		assertEquals(result, false);
	}
	
	public void test_aaa() throws IOException{
		DictionaryData.getDictionary();
		boolean result;
		Analyzer analyzer=new Analyzer();
		result= analyzer.modifier("aaa");
		assertEquals(result, false);
	}
	
	public void test_grade_1(){
		Analyzer analyzer = new Analyzer();	
		char grade = analyzer.return_grading(1);
		assertEquals(grade,'A');	
	}
	
	public void test_grade_2(){
		Analyzer analyzer = new Analyzer();	
		char grade = analyzer.return_grading(0.8);
		assertEquals(grade,'B');
	}
	
	public void test_grade_3(){
		Analyzer analyzer = new Analyzer();	
		char grade = analyzer.return_grading(0.65);
		assertEquals(grade,'C');
	}
	
	public void test_grade_4(){
		Analyzer analyzer = new Analyzer();	
		char grade = analyzer.return_grading(0.55);
		assertEquals(grade,'D');
	}
	
	public void test_grade_5(){
		Analyzer analyzer = new Analyzer();	
		char grade = analyzer.return_grading(0.41);
		assertEquals(grade,'E');
	}
	
	public void test_grade_6(){
		Analyzer analyzer = new Analyzer();	
		char grade = analyzer.return_grading(0.31);
		assertEquals(grade,'F');
	}
	
	public void test_handleInputArticle_1(){
		Analyzer analyzer = new Analyzer();	
		analyzer.handleInputArticle("abc");		
	}
	
	public void test_grading(){
		Analyzer analyzer = new Analyzer();	
		analyzer.grading();
	}
}
